<?php
  header('content-type:application/json;charset=utf-8');
  // 查询
  $mysql = new mysqli(SAE_MYSQL_HOST_M.":".SAE_MYSQL_PORT,SAE_MYSQL_USER,SAE_MYSQL_PASS,SAE_MYSQL_DB);
  $mysql->query("set names utf8");
  $sql = "SELECT*FROM game";
  $result = $mysql->query($sql);
  if ($result->num_rows > 0) {
    //转换成数组显示出来
      while($result2 = $result->fetch_array()){
      $rows[] = $result2;
    }
    echo json_encode($rows);
  }
  $mysql->close(); 
 ?>
